home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
pascal
/
pro11
/
testansi.pas
< prev
Wrap
Pascal/Delphi Source File
|
1985-11-01
|
2KB
|
61 lines
program ANSITest;
(****************************************************************)
(* *)
(* SOURCE MODULE: test ANSI device driver *)
(* TURBO PASCAL *)
(* MOD LEVEL: 1.00 *)
(* REQUIREMENTS: CONFIG.SYS contains 'DEVICE=ANSI.SYS' *)
(* and ANSI.SYS driver installed. *)
(****************************************************************)
Type
ANSIStr = String [ 255 ];
Var
Fileid : Text;
InputField : ANSIStr;
procedure WriteANSI( Str : ANSIStr) ;
Var
Regs: Record
Case Integer of
1: ( Ax, Bx, Cx, Dx, Bp, Di, Si, Ds, Es, Flags : Integer);
2: ( Al, Ah, Bl, Bh, Cl, Ch, Dl, Dh : Byte);
end;
i : integer;
begin { WriteANSI }
{test
Writeln( lst, 'The length of the string is : ', Length( Str ) );
Write( lst, ' It contains : ' );
for i := 1 to Length( Str ) do Write( lst, Ord( Str [ i ] ) : 4 );
Writeln( lst );
}
With Regs do begin
bx := 1; { file handle. 1 = Standard Screen Output }
cx := Length( Str );
ds := Seg( Str );
dx := Ofs( Str ) + 1; { address of actual ascii string }
ah := $40;
end;
MsDos( Regs );
end; { WriteANSI }
begin { program }
(*
WriteANSI( Chr(27) + '[33;44m' );
WriteANSI( 'This is a test of the ANSI Device Driver' );
*)
Assign( Fileid, 'asm00001');
Reset( Fileid );
While Not Eof( Fileid ) do begin
Readln( Fileid, InputField );
WriteANSI( InputField );
end;
Close( Fileid );
Read;
end. { program }